home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / text_utl / parsed / mdelim.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-04  |  8.7 KB  |  301 lines

  1. VERSION 2.00
  2. Begin Form frmMultiDelim 
  3.    Caption         =   "Parse Demo - Parse Test With Multiple Character Delimiter"
  4.    ClientHeight    =   5475
  5.    ClientLeft      =   120
  6.    ClientTop       =   735
  7.    ClientWidth     =   9075
  8.    Height          =   6195
  9.    Icon            =   MDELIM.FRX:0000
  10.    Left            =   45
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5475
  13.    ScaleWidth      =   9075
  14.    Top             =   90
  15.    Width           =   9225
  16.    Begin CommandButton cmdReturn 
  17.       Caption         =   "&Return To Main Menu"
  18.       Height          =   435
  19.       Left            =   5820
  20.       TabIndex        =   19
  21.       Top             =   480
  22.       Width           =   2715
  23.    End
  24.    Begin CommandButton cmdChange 
  25.       Caption         =   "&Change"
  26.       FontBold        =   0   'False
  27.       FontItalic      =   0   'False
  28.       FontName        =   "MS Sans Serif"
  29.       FontSize        =   8.25
  30.       FontStrikethru  =   0   'False
  31.       FontUnderline   =   0   'False
  32.       Height          =   315
  33.       Left            =   4140
  34.       TabIndex        =   21
  35.       Top             =   660
  36.       Width           =   915
  37.    End
  38.    Begin CommandButton cmdClear 
  39.       Caption         =   "C&lear"
  40.       FontBold        =   0   'False
  41.       FontItalic      =   0   'False
  42.       FontName        =   "MS Sans Serif"
  43.       FontSize        =   8.25
  44.       FontStrikethru  =   0   'False
  45.       FontUnderline   =   0   'False
  46.       Height          =   285
  47.       Left            =   7515
  48.       TabIndex        =   18
  49.       Top             =   1800
  50.       Width           =   555
  51.    End
  52.    Begin CommandButton cmdLoadEx 
  53.       Caption         =   "&Load Example"
  54.       Height          =   330
  55.       Left            =   195
  56.       TabIndex        =   0
  57.       Top             =   2280
  58.       Width           =   3090
  59.    End
  60.    Begin TextBox txtFullString 
  61.       Height          =   285
  62.       Left            =   1200
  63.       TabIndex        =   5
  64.       Tag             =   "txtFullString"
  65.       Top             =   1815
  66.       Width           =   6270
  67.    End
  68.    Begin TextBox txtDelim 
  69.       Height          =   285
  70.       Left            =   1200
  71.       TabIndex        =   3
  72.       Top             =   1410
  73.       Width           =   1095
  74.    End
  75.    Begin CommandButton cmdParse 
  76.       Caption         =   "&Parse"
  77.       Height          =   330
  78.       Left            =   3615
  79.       TabIndex        =   1
  80.       Top             =   2280
  81.       Width           =   3750
  82.    End
  83.    Begin Shape Shape1 
  84.       Height          =   1215
  85.       Left            =   120
  86.       Shape           =   4  'Rounded Rectangle
  87.       Top             =   60
  88.       Width           =   5160
  89.    End
  90.    Begin Label Label3 
  91.       Alignment       =   2  'Center
  92.       BorderStyle     =   1  'Fixed Single
  93.       Caption         =   "Currently Selected Function"
  94.       Height          =   315
  95.       Left            =   1440
  96.       TabIndex        =   20
  97.       Top             =   180
  98.       Width           =   2475
  99.    End
  100.    Begin Label lblCurFunc 
  101.       Caption         =   "lblCurFunc"
  102.       FontBold        =   -1  'True
  103.       FontItalic      =   -1  'True
  104.       FontName        =   "MS Sans Serif"
  105.       FontSize        =   9.75
  106.       FontStrikethru  =   0   'False
  107.       FontUnderline   =   0   'False
  108.       Height          =   375
  109.       Left            =   540
  110.       TabIndex        =   22
  111.       Top             =   660
  112.       Width           =   3375
  113.    End
  114.    Begin Label lblString 
  115.       BorderStyle     =   1  'Fixed Single
  116.       Height          =   270
  117.       Index           =   11
  118.       Left            =   4155
  119.       TabIndex        =   17
  120.       Top             =   4770
  121.       Width           =   3000
  122.    End
  123.    Begin Label lblString 
  124.       BorderStyle     =   1  'Fixed Single
  125.       Height          =   270
  126.       Index           =   10
  127.       Left            =   4155
  128.       TabIndex        =   16
  129.       Top             =   4395
  130.       Width           =   3000
  131.    End
  132.    Begin Label lblString 
  133.       BorderStyle     =   1  'Fixed Single
  134.       Height          =   270
  135.       Index           =   9
  136.       Left            =   4155
  137.       TabIndex        =   15
  138.       Top             =   4020
  139.       Width           =   3000
  140.    End
  141.    Begin Label lblString 
  142.       BorderStyle     =   1  'Fixed Single
  143.       Height          =   270
  144.       Index           =   8
  145.       Left            =   4155
  146.       TabIndex        =   14
  147.       Top             =   3630
  148.       Width           =   3000
  149.    End
  150.    Begin Label lblString 
  151.       BorderStyle     =   1  'Fixed Single
  152.       Height          =   270
  153.       Index           =   7
  154.       Left            =   4155
  155.       TabIndex        =   13
  156.       Top             =   3240
  157.       Width           =   3000
  158.    End
  159.    Begin Label lblString 
  160.       BorderStyle     =   1  'Fixed Single
  161.       Height          =   270
  162.       Index           =   6
  163.       Left            =   4155
  164.       TabIndex        =   12
  165.       Top             =   2880
  166.       Width           =   3000
  167.    End
  168.    Begin Label lblString 
  169.       BorderStyle     =   1  'Fixed Single
  170.       Height          =   270
  171.       Index           =   5
  172.       Left            =   855
  173.       TabIndex        =   10
  174.       Top             =   4770
  175.       Width           =   3000
  176.    End
  177.    Begin Label lblString 
  178.       BorderStyle     =   1  'Fixed Single
  179.       Height          =   270
  180.       Index           =   4
  181.       Left            =   855
  182.       TabIndex        =   11
  183.       Top             =   4395
  184.       Width           =   3000
  185.    End
  186.    Begin Label lblString 
  187.       BorderStyle     =   1  'Fixed Single
  188.       Height          =   270
  189.       Index           =   3
  190.       Left            =   855
  191.       TabIndex        =   9
  192.       Top             =   4005
  193.       Width           =   3000
  194.    End
  195.    Begin Label lblString 
  196.       BorderStyle     =   1  'Fixed Single
  197.       Height          =   270
  198.       Index           =   2
  199.       Left            =   855
  200.       TabIndex        =   8
  201.       Top             =   3615
  202.       Width           =   3000
  203.    End
  204.    Begin Label lblString 
  205.       BorderStyle     =   1  'Fixed Single
  206.       Height          =   270
  207.       Index           =   1
  208.       Left            =   855
  209.       TabIndex        =   7
  210.       Top             =   3240
  211.       Width           =   3000
  212.    End
  213.    Begin Label lblString 
  214.       BorderStyle     =   1  'Fixed Single
  215.       Height          =   270
  216.       Index           =   0
  217.       Left            =   855
  218.       TabIndex        =   6
  219.       Top             =   2880
  220.       Width           =   3000
  221.    End
  222.    Begin Label Label2 
  223.       Caption         =   "&Full String:"
  224.       Height          =   255
  225.       Left            =   210
  226.       TabIndex        =   4
  227.       Top             =   1830
  228.       Width           =   930
  229.    End
  230.    Begin Label Label1 
  231.       Caption         =   "&Delimiter:"
  232.       Height          =   255
  233.       Left            =   210
  234.       TabIndex        =   2
  235.       Top             =   1410
  236.       Width           =   900
  237.    End
  238.    Begin Menu mnuExit 
  239.       Caption         =   "E&xit!"
  240.    End
  241. Option Explicit
  242. Sub cmdChange_Click ()
  243.     Me.WindowState = MINIMIZED
  244.     Screen.MousePointer = HOURGLASS
  245.     SetfrmSelect (lblCurFunc), FLG_MULTIDELIM
  246. End Sub
  247. Sub cmdClear_Click ()
  248.    txtFullString = ""
  249.    txtFullString.SetFocus
  250. End Sub
  251. Sub cmdLoadEx_Click ()
  252.    txtDelim = "|delim|"
  253.    txtFullString = "This|delim|is|delim|a test of|delim|ParseAndFillArray|delim|routine."
  254.    cmdParse.SetFocus
  255. End Sub
  256. Sub cmdParse_Click ()
  257.    Dim numelements%, i%
  258.    Dim TheString$, Delim$
  259.    Dim DynArray$()
  260.    Screen.MousePointer = HOURGLASS
  261.    'clear out labels
  262.    For i% = 0 To 11
  263.       lblString(i%) = ""
  264.    Next i%
  265.    'allow them to clear
  266.    DoEvents
  267.    TheString$ = txtFullString
  268.    Delim$ = txtDelim
  269.     'call the appropriate function
  270.    If lblCurFunc = "ParseAndFillArray1%()" Then
  271.       numelements% = ParseAndFillArray1%(TheString$, Delim$, DynArray$())
  272.    ElseIf lblCurFunc = "ParseAndFillArray2%()" Then
  273.       numelements% = ParseAndFillArray2%(TheString$, Delim$, DynArray$(), 10)
  274.    Else
  275.       numelements% = ParseAndFillListBox%(TheString$, Delim$, frmListBox!List1)
  276.    End If
  277.    'set max of 12 string parts for sake of example
  278.    If numelements% > 12 Then
  279.       numelements% = 12
  280.    End If
  281.    'put elements into labels
  282.    For i% = 1 To numelements%
  283.       lblString(i% - 1) = DynArray$(i%)
  284.    Next i%
  285.    Screen.MousePointer = DEFAULT
  286. End Sub
  287. Sub cmdReturn_Click ()
  288.     Me.WindowState = MINIMIZED
  289.     frmMain.Show
  290.     frmMain.WindowState = NORMAL
  291. End Sub
  292. Sub Form_Activate ()
  293.    Screen.MousePointer = DEFAULT
  294. End Sub
  295. Sub Form_Unload (Cancel As Integer)
  296.    End
  297. End Sub
  298. Sub mnuExit_Click ()
  299.     EndProg
  300. End Sub
  301.